package com.example.service.impl;

import com.example.dao.YhMapper;
import com.example.service.LogService;
import com.example.service.YhService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
public class YhServiceImpl implements YhService {

    @Autowired
    private YhMapper yhMapper;

    @Autowired
    private LogService logService;

    @Override
    public void tranYe(String in, String out, Double ye) {
        try {
            yhMapper.updateJq(out,ye);
            int i=1/0;
            yhMapper.updateZq(in,ye);
        }finally {
            logService.insertLog(in,out,ye);
        }
    }
}
